<!--
 * @Author: 赵克强 huohuo625@163.com
 * @Date: 2024-04-24 16:05:57
 * @LastEditors: 赵克强 huohuo625@163.com
 * @LastEditTime: 2024-07-30 14:36:20
 * @FilePath: \hy-ui\src\views\system\notice\detail.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="noticeDetail">
    <el-card class="box-card" shadow="never">
      <div slot="header" class="clearfix">
        <span>{{selectDictLabel(dict.type.sys_notice_type, form.noticeType)}}详情</span>
        <el-button style="float: right;" type="primary" size="mini" @click="handleBack">返回</el-button>
      </div>
      <el-form label-width="120px">
        <el-form-item label="公告标题：" class="line"><span class="title">{{ form.noticeTitle }}</span></el-form-item>
        <el-form-item label="公告类型：" class="line"
          >{{
            selectDictLabel(dict.type.sys_notice_type, form.noticeType)
          }} </el-form-item
        ><el-form-item label="状态：" class="line"
          >{{
            selectDictLabel(dict.type.sys_notice_status, form.status)
          }} </el-form-item
        ><el-form-item label="内容：" class="line"
          ><div v-html="form.noticeContent" style="width:90%"></div
        ></el-form-item>
      </el-form>
    </el-card>
  </div>
</template>

<script>
import {
  listNotice,
  getNotice,
  delNotice,
  addNotice,
  updateNotice,
} from "@/api/system/notice";
export default {
  dicts: ["sys_notice_status", "sys_notice_type"],
  data() {
    return {
      form: {},
    };
  },
  methods: {
    async getDetail() {
      const response = await getNotice(this.$route?.params?.noticeId);
      this.form = response.data;
    },
    handleBack(){
       this.$tab.closePage();
      this.$router.go(-1);
    }
  },
  mounted() {
    this.getDetail();
  },
};
</script>
<style scoped lang="scss">
.noticeDetail {
  width: 100%;
  background: #f5f1f1;
  padding: 10px;
  ::v-deep .el-card__body {
    min-height: 88vh;
  }
}
.title{font-weight: 600; font-size: 18px}
.line{border-bottom: 1px #e7dddd solid}
</style>
